// index.js

const API = require("../../utils/API")
const http = require("../../utils/http")
const submenuList = require("./data")

// 获取应用实例
const app = getApp()

Page({
  data: {
    //轮播图列表
    sliderList:[],
    submenuList,
    //直播列表
    courseList:[],
    //热门教学
    hotList:[],
    //回答列表
    answerList:[],
    //素材列表
    materialList:[],
   
  },
  onLoad() {
   http("https://m.lanqb.com/api/home/banner?type=m&local_code=10&order=weight&limit=8").then(res=>{
     this.setData({sliderList:res.data.data})
   })
   http(API.courseIndex).then(res=>{
     console.log(res.data.live,88888888);
     this.setData({courseList:res.data.live})
   })
   //热门教学请求
   http(API.hot).then(res=>{
    this.setData({hotList:res.data})
  })
  //回答专区请求
  http(API.answerList).then(res=>{
    
    this.setData({answerList:res.data})
  })
  //素材列表请求
  http(API.material).then(res=>{
    console.log(res);
    this.setData({materialList:res.data.data})
  })
  },
})
